# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=shellen
pkgver=66.c0c5f83
pkgrel=7
pkgdesc='Interactive shellcoding environment to easily craft shellcodes.'
groups=('blackarch' 'blackarch-exploitation')
arch=('any')
url='https://github.com/merrychap/shellen'
license=('MIT')
depends=('python' 'python-requests' 'python-termcolor' 'python-colorama'
         'python-pygments' 'python-terminaltables' 'python-capstone'
         'python-keystone' 'python-prompt_toolkit')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/merrychap/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed 's|keystone-engine|keystone|g' -i setup.py
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.*
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.*
}

